{include file="public/header"}
<div class="page-content">
    <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
        <div class="widget am-cf" style=" height: 500px;">
            <div class="widget-head am-cf">
                <div class="widget-title am-cf">评论列表</div>
            </div>
            <div class="widget-body am-fr">
                <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                    <div class="am-form-group">
                    </div>
                </div>
                <div class="am-u-sm-12">
                <table class="am-table am-table-compact am-table-striped tpl-table-black" id="dyntable">
                    <thead>
                        <tr>
                            <th class="head0 nosort"><input type="checkbox" class="checkall" /></th>
                            <th class="center">ID</th>
                            <th class="center">用户名</th>
                            <th class="center">美食名</th>
                            <th class="center">评价分数</th>
                            <th class="center">评价内容</th>
                            <th class="center">评价时间</th>                                                       
                            <th class="center">删除</th>
                        </tr>
                    </thead>
                    <tbody>
                        {volist name="edata" id="vo"}
                            <tr class="gradeX">
                                <td class="aligncenter">
                                    <span class="center">
                                        <input type="checkbox" />
                                    </span>
                                </td>
                                <td>{$vo.id}</td>
                                <td>{$vo.users.username}</td>
                                <td>{$vo.foods.name}</td>
                                <td> {$vo.grade}</td>
                                <td>
                                    {if condition="($vo.content eq '')"} 无
                                    {else /}{$vo.content|substr=0,20}
                                    {/if}
                                </td>
                                 <td>{$vo.posttime|date="Y-m-d H:i:s",###}</td>
                                <td class="center">
                                    <a onclick="showDel('{$vo.id}')"
                                       class="item-delete tpl-table-black-operation-del">
                                        <i class="am-icon-trash"></i> 删除
                                    </a>
                                </td>
                            </tr>
                        {/volist}
                    </tbody>
                </table>
                    {$edata->render()}
            </div>
        </div>
        
    </div>
</div>
</div>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
    layui.use(['element','layer'], function(){
        var element = element;});

    function showDel(no) {
        var layer = layui.layer;
        layer.confirm('确认删除？', {
            btn: ['确认', '取消'] //可以无限个按钮
        }, function (index, layero) {
            //按钮【按钮一】的回调
            location.href="{:url('evaluate/del')}"+"?no="+no;
        }, function (index) {
            //按钮【按钮二】的回调
        });
    }
</script>
</body>
</html>